package fun.codedesign.datasource.example.service.impl;

import fun.codedesign.datasource.example.domain.Person;
import fun.codedesign.datasource.example.repository.PersonRepository;
import fun.codedesign.datasource.example.service.PersonService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PersonServiceImpl implements PersonService {

    private final PersonRepository personRepository;

    public PersonServiceImpl(PersonRepository personRepository) {
        this.personRepository = personRepository;
    }

    @Override
    public List<Person> getList() {
        return personRepository.findAll();
    }
}
